#include <iostream>
#include <cstring>
using namespace std;
int main(int argc, char* argv[])
{
    if(argc != 2)
    {
        printf("Usage:%s filename", argv[0]);
        return 1;
    }
    FILE* pf = fopen(argv[1], "r");
    if(pf == nullptr)
    {
        perror("fopen");
        return 2;
    }
    while(1)
    {
        char buffer[128];
        memset(buffer, 0, sizeof(buffer));
        int n = fread(buffer, sizeof(buffer) - 1, 1, pf);
        if(n > 0)
        {
            printf("%s", buffer);
        }
        if(feof(pf))
        {
            break;
        }
    }
    cout << endl;
    fclose(pf);
    return 0;
}
